Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(examples): Implement p/demo/dequeue & p/demo/ratelimiter #2170

Open
wants to merge 85 commits into
base: master
Choose a base branch
from

Conversation

linhpn99
Copy link
Contributor

@linhpn99 linhpn99 commented May 23, 2024

From issue : #2119

Using Dequeue in the rate_limiter package optimizes action history management by enabling efficient additions and removals at both ends of the queue. This approach ensures constant-time operations and better performance for rate-limiting mechanisms

Contributors' checklist...
  • Added new tests, or not needed, or not feasible
  • Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
  • Updated the official documentation or not needed
  • No breaking changes were made, or a BREAKING CHANGE: xxx message was included in the description
  • Added references to related issues and PRs
  • Provided any useful hints for running manual tests
  • Added new benchmarks to generated graphs, if any. More info here.

@linhpn99 linhpn99 requested review from a team as code owners May 23, 2024 08:57
@linhpn99 linhpn99 requested review from ajnavarro and deelawn and removed request for a team May 23, 2024 08:57
@github-actions github-actions bot added the 🧾 package/realm Tag used for new Realms or Packages. label May 23, 2024
@linhpn99
Copy link
Contributor Author

@moul i have just implemented queue structure, please take a look !

// PushFront adds an element to the front of the queue.
// Returns an error if the queue is full.
func (q *Queue) PushFront(value interface{}) error {
if q.begin-1 == q.end {
Copy link
Member

@moul moul May 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With q.begin (uint) set to 0 by default, you may encounter an issue here.

Copy link
Contributor Author

@linhpn99 linhpn99 May 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested this case, q.begin will equal max.Uint64 and does not cause any other runtime errors

@moul
Copy link
Member

moul commented May 26, 2024

You are adding general-purpose libraries, which is good. However, it's challenging to review without a real usage example. Could you create dapps using your new libraries or provide more actionable examples?

@linhpn99 linhpn99 requested a review from moul May 27, 2024 02:33
Copy link

codecov bot commented Jul 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@linhpn99 linhpn99 changed the title feat(examples): Implement p/demo/dequeue feat(examples): Implement p/demo/dequeue & p/demo/rate_limiter Aug 21, 2024
@linhpn99 linhpn99 marked this pull request as ready for review August 21, 2024 15:18
@linhpn99 linhpn99 changed the title feat(examples): Implement p/demo/dequeue & p/demo/rate_limiter feat(examples): Implement p/demo/dequeue & p/demo/ratelimiter Aug 21, 2024
Copy link

github-actions bot commented Dec 4, 2024

This PR is stale because it has been open 3 months with no activity. Remove stale label or comment or this will be closed in 3 months.

@github-actions github-actions bot added the Stale label Dec 4, 2024
@Gno2D2
Copy link
Collaborator

Gno2D2 commented Dec 4, 2024

I'm a bot that assists the Gno Core team in maintaining this repository. My role is to ensure that contributors understand and follow our guidelines, helping to streamline the development process.

The following requirements must be fulfilled before a pull request can be merged.
Some requirement checks are automated and can be verified by the CI, while others need manual verification by a staff member.

These requirements are defined in this configuration file.

Automated Checks

🟢 Maintainers must be able to edit this pull request
🔴 The pull request head branch must be up-to-date with its base

Manual Checks

  • The pull request description provides enough details
Debug
Automated Checks
Maintainers must be able to edit this pull request

If

🟢 Condition met
└── 🟢 On every pull request

Then

🟢 Requirement satisfied
└── 🟢 Maintainer can modify this pull request

The pull request head branch must be up-to-date with its base

If

🟢 Condition met
└── 🟢 On every pull request

Then

🔴 Requirement not satisfied
└── 🔴 Head branch (linhpn99:add-package-queue) is up to date with base (master): behind by 201 / ahead by 85

Manual Checks
The pull request description provides enough details

If

🟢 Condition met
└── 🟢 Not (🔴 Pull request author is a member of the team: core-contributors)

Can be checked by

  • team core-contributors

@github-actions github-actions bot removed the Stale label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧾 package/realm Tag used for new Realms or Packages.
Projects
Status: In Progress
Status: In Review
Development

Successfully merging this pull request may close these issues.

4 participants